﻿using BulletSharp;
using System;
using System.Collections.Generic;
using System.Text;

namespace ETModel {
    [ObjectSystem]
    public class BulletCollisionShapeAwakeSystem : AwakeSystem<BulletCollisionShape, CollisionShape> {
        public override void Awake(BulletCollisionShape self, CollisionShape shape) {
            self.Awake(shape);
        }
    }
    public class BulletCollisionShape : Component, IDisposable {

        public CollisionShape Shape { get; set; }

        /// <summary>
        /// 默认构造形状
        /// </summary>
        public void Awake(CollisionShape shape) {
            Shape = shape;
            Shape.UserObject = this;
        }

        public override void Dispose() {
            if (Shape != null) {
                Shape.Dispose();
                Shape = null;
            }

            base.Dispose();
        }
    }
}
